<?php //pack11class

class ObjectCardList extends Module {

    public $traceEnabled=true;

    public function setup() {
        $this->setID("ObjectCardInfo");
        if(get_class($this->param)!="DekaroObject") return false;

        $description=new ObjectCardDescription();
        //$description->setBody(html_entity_decode(str_replace(array("\r\n", "\r", "\n"), '<br />', $this->param->description[LanguagesManager::current()])));
        $description->setBody(html_entity_decode($this->param->description[LanguagesManager::current()]));
        $this->addChild($description);

        $this->addChild(new ObjectCardPrice($this->param));
        $price=$this->param->getMoney(true);
        if($price) {
            $small=new ObjectCardPriceSmall;
            $small->setBody($price);
            $this->addChild($small);
        }

        $properties=$this->param->usedProperties();
        foreach($properties as $property) {
            if($property->group!="address" && $property->group!="category" && $property->group!="media" && $property->group!="price" && !$property->combined && $property->system!="special") {
                $item=new ObjectCardProperty;
                $item->label=$property->label;
                $item->value=$property->string;
                $this->addChild($item);
            }
        }

    }

}
?>
